﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WF.DAL;

namespace WF.Model
{
    [Serializable]
    public class WF_AuditHistoryEntity : EntityBase<WF_AuditHistory>
    {
        #region 构造函数

        public WF_AuditHistoryEntity() : base() { }
        public WF_AuditHistoryEntity(WF_AuditHistory obj) : base(obj) { }
        #endregion

        #region 实现基类abstract属性


        public override string ID
        {
            get
            {
                return DbEntity.RowID;
            }
            set
            {
                DbEntity.RowID = value; this.SendPropertyChanged("RowID");
            }
        }

        public override string DisplayName
        {
            get { return DbEntity.RowID; }
        }

        #endregion

        #region Properties
        public string ApplyID
        {
            get
            {
                return DbEntity.ApplyID;
            }
            set
            {
                DbEntity.ApplyID = value; this.SendPropertyChanged("ApplyID");
            }
        }

        public string ActivityName
        {
            get
            {
                return DbEntity.ActivityName;
            }
            set
            {
                DbEntity.ActivityName = value; this.SendPropertyChanged("ActivityName");
            }
        }

        public string EmpID
        {
            get
            {
                return DbEntity.EmpID;
            }
            set
            {
                DbEntity.EmpID = value; this.SendPropertyChanged("EmpID");
            }
        }

        public string UserName
        {
            get
            {
                return DbEntity.UserName;
            }
            set
            {
                DbEntity.UserName = value; this.SendPropertyChanged("UserName");
            }
        }

        public string DomainAccount
        {
            get
            {
                return DbEntity.DomainAccount;
            }
            set
            {
                DbEntity.DomainAccount = value; this.SendPropertyChanged("DomainAccount");
            }
        }

        public string ApprovalResult
        {
            get
            {
                return DbEntity.ApprovalResult;
            }
            set
            {
                DbEntity.ApprovalResult = value; this.SendPropertyChanged("ApprovalResult");
            }
        }

        public string ApprovalComment
        {
            get
            {
                return DbEntity.ApprovalComment;
            }
            set
            {
                DbEntity.ApprovalComment = value; this.SendPropertyChanged("ApprovalComment");
            }
        }

        public System.DateTime ApprovalDate
        {
            get
            {
                return DbEntity.ApprovalDate;
            }
            set
            {
                DbEntity.ApprovalDate = value; this.SendPropertyChanged("ApprovalDate");
            }
        }
        #endregion

        /// <summary>
        /// 从数据库对象创建逻辑对象
        /// </summary>
        /// <param name="job">数据库对象</param>
        /// <returns>逻辑对象</returns>
        [Obsolete("请使用 new WF_AuditHistoryEntity(obj) ")]
        public static WF_AuditHistoryEntity CreateEntityFromDb(WF_AuditHistory obj)
        {
            if (null == obj) return null;
            WF_AuditHistoryEntity ret = new WF_AuditHistoryEntity(obj);
            return ret;
        }

        //#region IEntity
        //public bool Add(WF.IDataLayer DataLayer)
        //{
        //    return DataLayer.Add(this);
        //}

        //public bool Update(WF.IDataLayer DataLayer)
        //{
        //    return DataLayer.Update(this);
        //}

        //public bool Delete(WF.IDataLayer DataLayer)
        //{
        //    return DataLayer.DeleteWF_AuditHistoryEntity(this.ID);
        //}

        //public bool GetDetail(WF.IDataLayer DataLayer)
        //{
        //    WF_AuditHistoryEntity result;
        //    if (!DataLayer.GetWF_AuditHistoryEntityById(this.ID, out result))
        //    {
        //        return false;
        //    }
        //    this._DALObject = result._DALObject;
        //    return true;
        //}
        //#endregion

    }
}
